﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.EntityFrameworkCore.Infrastructure;

namespace YixiaoIdentity.Auth.Data
{
    public class AuthDbContextFactory : IDesignTimeDbContextFactory<AuthDbContext>
    {

        AuthDbContext IDesignTimeDbContextFactory<AuthDbContext>.CreateDbContext(string[] args)
        {
            var optionsBuilder = new DbContextOptionsBuilder<AuthDbContext>();
            optionsBuilder.UseSqlServer(ApplicationDbConfig.ConnectString);

            return new AuthDbContext(optionsBuilder.Options);
        }
    }

    public class ApplicationDbConfig
    {
       public  static readonly string ConnectString = "Server=www.i5g.club;Database=YixiaoAdmin;User ID=sa;Password=asqmkj147@";
    }
}